#!/bin/bash

############################################################################
#
# 远程执行该脚本，请在命令行中直接执行以下命令：
#
#   curl -sSL https://gitee.com/tay3223/biubiubiu/raw/master/centos7-install-filebeat.sh | /bin/bash
#
#
############################################################################

# 添加yum源
tee /etc/yum.repos.d/elastic-7.repo <<EOF
[elastic-7.x]
name=Elastic repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF

# 安装docker
yum install -y filebeat

systemctl daemon-reload

cat <<Tay

====================================
1.filebeat安装成功...
2.相关命令：
    systemctl restart filebeat
    systemctl status filebeat
    systemctl enable filebeat
====================================

Tay
